import request from '../request'

function loginByPassword(data) {
	// #ifdef APP||APP-PLUS
	data.push_client = uni.getStorageSync('push_client')
	// #endif
	return request.post('/api/account/loginByPassword', data, {}, false)
}

function loginByVcode(data) {
	// #ifdef APP||APP-PLUS
	data.push_client = uni.getStorageSync('push_client')
	// #endif
	return request.post('/api/account/loginByVcode', data, {}, false)
}

function registerByVcode(data) {
	// #ifdef APP||APP-PLUS
	data.push_client = uni.getStorageSync('push_client')
	// #endif
	return request.post('/api/account/registerByVcode', data, {}, false)
}

function checkAccount(data) {
	return request.post('/api/account/checkAccount', data, {}, false)
}

function sendVcode(query) {
	return request.get('/api/account/vcode', query, false)
}

function changePhone(data) {
	return request.post('/api/account/changePhone', data)
}

function changePassword(data) {
	return request.post('/api/account/changePassword', data)
}

function info(data) {
	return request.get('/api/account/info',data)
}

function updateInfo(data) {
	return request.post('/api/account/updateInfo',data)
}

function loginByWx(data) {
	return request.post('/api/account/loginByWx',data,{},false)
}

function bindWx(data) {
	return request.post('/api/account/bindWx',data,{},false)
}

//注销账号
function unsubscribe(data) {
	return request.post('/api/account/unsubscribe',data)
}

//发送绑定手机验证码
function sendBindPhoneVcode(data) {
	return request.get('/api/account/sendBindPhoneVcode',data)
}



export default {
	loginByPassword,
	loginByVcode,
	registerByVcode,
	checkAccount,
	sendVcode,
	changePhone,
	changePassword,
	info,
	updateInfo,
	loginByWx,
	bindWx,
	unsubscribe,
	sendBindPhoneVcode,
}